package com.kaifamiao.date1111;

public class AnimalTest {

	public static void main(String[] args) {
		
		Animal a = null ;
		
		a = new Bear( "熊二" );
		a.eat( "蜂蜜" );
		
		if( a instanceof Beast b ) {
			b.run();
		}
		
		a = new Owl( "涂涂" );
		a.eat( "老鼠" );
		
		if( a instanceof Birds b ) {
			b.fly();
		}

	}

}
